home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / pack.z / pack
Encoding:
Text File  |  1998-10-30  |  3.0 KB  |  74 lines

  1. PACK(3I)                                               Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPAACCKK - Packs an array into an array of rank one under control of a
  6.      mask
  7.  
  8. SSYYNNOOPPSSIISS
  9.      PPAACCKK (([AARRRRAAYY==]_a_r_r_a_y,, [MMAASSKK==]_m_a_s_k [,,[VVEECCTTOORR==]_v_e_c_t_o_r]))
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. SSTTAANNDDAARRDDSS
  15.      Fortran 90
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.      The PPAACCKK intrinsic function packs an array into an array of rank one
  19.      under control of a mask.  It can be used for array construction.  It
  20.      accepts the following arguments:
  21.  
  22.      _a_r_r_a_y     Can be of any type.  It must not be scalar.
  23.  
  24.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  25.  
  26.      _v_e_c_t_o_r    Must be of the same type as _a_r_r_a_y and must have rank one.
  27.                _v_e_c_t_o_r must have at least as many elements as there are true
  28.                elements in _m_a_s_k.  If _m_a_s_k is scalar with the value true,
  29.                _v_e_c_t_o_r must have at least as many elements as there are in
  30.                _a_r_r_a_y.
  31.  
  32.      PPAACCKK is a transformational function.  The name of this intrinsic
  33.      cannot be passed as an argument.
  34.  
  35. RREETTUURRNN VVAALLUUEESS
  36.      The result is an array of rank one of the same type as _a_r_r_a_y.  If
  37.      _v_e_c_t_o_r is present, the result size is that of _v_e_c_t_o_r; otherwise, the
  38.      result size is the number _t of true elements in _m_a_s_k unless _m_a_s_k is
  39.      scalar with the value true in which case the result size is the size
  40.      of _a_r_r_a_y.
  41.  
  42.      Element _i of the result is the element of _a_r_r_a_y that corresponds to
  43.      the _ith true element of _m_a_s_k, taking elements in array element order,
  44.      for _i=1, 2, ..., _t.  If _v_e_c_t_o_r is present and has size _n>_t, element _i
  45.      of the result has the value _v_e_c_t_o_r(_i), for _i=_t+1, ..., _n.
  46.  
  47. EEXXAAMMPPLLEESS
  48.      Example 1:  If NN == ((// 11,, --11,, 33 //)), the following are true:
  49.  
  50.           PPAACCKK(( NN,, MMAASSKK==NN..LLTT..00)) is [-1].
  51.  
  52.           PPAACCKK(( NN,, MMAASSKK==..TTRRUUEE..)) is [1, -1, 3].
  53.  
  54.      Example 2:  Array MM is as follows:
  55.  
  56.         | 0 0 0 |
  57.  
  58.         | 9 0 0 |
  59.  
  60.         | 0 0 7 |
  61.  
  62.      The nonzero elements of array MM can be gathered by the PPAACCKK function.
  63.      The following are the results:
  64.  
  65.           PPAACCKK((MM,, MMAASSKK==MM..NNEE..00)) is [9, 7].
  66.  
  67.           PPAACCKK((MM,, MMAASSKK==MM..NNEE..00,, VVEECCTTOORR==((//22,, 44,, 66,, 88,, 1100,, 1122//)))) is [9, 7, 6,
  68.           8, 10 12].
  69.  
  70. SSEEEE AALLSSOO
  71.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  72.      printed version of this man page.
  73.  
  74.